package com.yzt.minemodule.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.yzt.zhuju.base.BaseActivity;
import com.yzt.zhuju.config.AppConfigCacheManager;
import com.yzt.minemodule.R;
import com.yzt.p_base.utils.AppInfoUtils;

/**
 * author : bob
 * date   : 2022/12/1
 * desc   : 关于我们
 */
@SuppressLint("SetTextI18n")
public class AboutUsActivity extends BaseActivity {

    public static void start(Activity activity) {
        activity.startActivity(new Intent(activity, AboutUsActivity.class));
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_about_us;
    }

    @Override
    public void installViews() {

        mTitleBar.setTitle(R.string.setting_about_us);

        TextView appVersion = findViewById(R.id.about_us_app_version);
        appVersion.setText("v" + AppInfoUtils.getAppVersionName(mActivity));

        TextView appName = findViewById(R.id.tv_app_name);
        appName.setText(AppInfoUtils.getAppName(mActivity));

        TextView titLabelIv = findViewById(R.id.tit_label_iv);
        titLabelIv.setText(R.string.setting_check_update);

        if (AppConfigCacheManager.getInstance().isNewVersion()) {
            findViewById(R.id.msg_view).setVisibility(View.VISIBLE);
            titLabelIv.setText(R.string.setting_check_update_new);
        } else {
            findViewById(R.id.msg_view).setVisibility(View.GONE);
        }
    }
}
